package cn.lizemin.flowable.common;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author lzm
 * @Date 2024/6/30
 * @description
 */
@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public RespBean exception(Exception e) {
        log.error("发生了异常：{}", ExceptionUtils.getStackTrace(e));
        return RespBean.fail(e);
    }


}
